/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.eventos.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author oscar
 */
@Entity
@Table(name = "eca_tipo_concepto")
@NamedQueries({@NamedQuery(name = "TipoConcepto.findAll", query = "SELECT t FROM TipoConcepto t"), @NamedQuery(name = "TipoConcepto.findByTpcCodigo", query = "SELECT t FROM TipoConcepto t WHERE t.tpcCodigo = :tpcCodigo"), @NamedQuery(name = "TipoConcepto.findByTpcNombre", query = "SELECT t FROM TipoConcepto t WHERE t.tpcNombre = :tpcNombre"), @NamedQuery(name = "TipoConcepto.findByTpcEstado", query = "SELECT t FROM TipoConcepto t WHERE t.tpcEstado = :tpcEstado")})
public class TipoConcepto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "tpc_codigo")
    private Integer tpcCodigo;
    @Column(name = "tpc_nombre")
    private String tpcNombre;
    @Column(name = "tpc_estado")
    private Boolean tpcEstado;
    @OneToMany(mappedBy = "tpcCodigo", fetch = FetchType.LAZY)
    private List<DetalleConcepto> detalleConceptoCollection;

    public TipoConcepto() {
    }

    public TipoConcepto(Integer tpcCodigo) {
        this.tpcCodigo = tpcCodigo;
    }

    public Integer getTpcCodigo() {
        return tpcCodigo;
    }

    public void setTpcCodigo(Integer tpcCodigo) {
        this.tpcCodigo = tpcCodigo;
    }

    public String getTpcNombre() {
        return tpcNombre;
    }

    public void setTpcNombre(String tpcNombre) {
        this.tpcNombre = tpcNombre;
    }

    public Boolean getTpcEstado() {
        return tpcEstado;
    }

    public void setTpcEstado(Boolean tpcEstado) {
        this.tpcEstado = tpcEstado;
    }

    public List<DetalleConcepto> getDetalleConceptoCollection() {
        return detalleConceptoCollection;
    }

    public void setDetalleConceptoCollection(List<DetalleConcepto> detalleConceptoCollection) {
        this.detalleConceptoCollection = detalleConceptoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tpcCodigo != null ? tpcCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoConcepto)) {
            return false;
        }
        TipoConcepto other = (TipoConcepto) object;
        if ((this.tpcCodigo == null && other.tpcCodigo != null) || (this.tpcCodigo != null && !this.tpcCodigo.equals(other.tpcCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.eventos.be.TipoConcepto[tpcCodigo=" + tpcCodigo + "]";
    }

}
